package com.zyh.homework.test2;

/**
 * @Author zyh
 * @Date 2024/8/7 17:23
 * @Description
 */

public class NumberPrinter extends Thread{
    private Printer p;

    public Printer getP() {
        return p;
    }

    public void setP(Printer p) {
        this.p = p;
    }

    public NumberPrinter() {
    }

    public NumberPrinter(Printer p) {
        this.p = p;
    }

    @Override
    public void run() {
        for (int i = 1; i < 53; i++) {
            p.print(i);
        }
    }
}
